package cn.jiadakeji.parent.controller;

import cn.jiadakeji.parent.common.core.controller.BaseController;
import cn.jiadakeji.parent.common.core.domain.AjaxResult;
import cn.jiadakeji.parent.common.page.PageDomain;
import cn.jiadakeji.parent.common.page.TableDataInfo;
import cn.jiadakeji.parent.dto.SchoolDTO;
import cn.jiadakeji.parent.service.SchoolService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author heyanfeng
 * @create 2022-03-10 11:09
 */
@Api(value = "学校信息",tags = {"学校信息接口"})
@RestController
@RequestMapping("/school")
public class SchoolController extends BaseController {

    @Autowired
    private SchoolService schoolService;

    @ApiOperation("获取所有学校信息")
    @GetMapping("/schoolList")
    public TableDataInfo getSchoolList() {
        startPage();
        List<SchoolDTO> schoolDTOList = schoolService.getSchoolList();
        return getDataTable(schoolDTOList);
    }
}
